package com.lee.pullrefresh.adapter
;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.lee.pullrefresh.R;
import com.lee.pullrefresh.http.test.GetTestData;

public class TestDataAdapter extends VHAdapter {

	public TestDataAdapter(Activity c) {
		super(c);
	}

	@Override
	protected View createItemView(int position) {
		View v = null;
		v = ((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.list_item, null);
		return v;
	}

	@Override
	protected VH createViewHolder(int position) {
		VH vh = null;
		vh = new VHMore();
		return vh;
	}

	private class VHMore extends VH{
		TextView tv_1;

		@Override
		public void setupViewItem(View v, int position) {
			if (v != null) {
				tv_1 = (TextView) v.findViewById(R.id.tv_1);
			}
		}

		@Override
		public void fillViewItem(Object obj, int position) {
			if (obj != null) {
				GetTestData testData = (GetTestData) obj;
				tv_1.setText(testData.product_amount+"");
			}
		}}
}
